package com.rongke.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.rongke.mapper.MessageMapper;
import com.rongke.model.Message;
import com.rongke.service.MessageService;

import org.springframework.stereotype.Service;

/**
 * @MessageServiceImpl
 * @消息公告ServiceImpl
 * @version : Ver 1.0
 */
@Service
public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> implements
                                                                           MessageService {

    @Override
    public List<Message> selectFrontPageNotice() {
        EntityWrapper<Message> ew = new EntityWrapper<Message>();
        ew.eq("deleted", "0");
        //置顶的优先，然后看index排序，相同排序的看最后修改时间倒序
        ew.orderBy("`top` desc").orderBy("`index` asc").orderBy("gmt_modified desc");
        return baseMapper.selectList(ew);
    }
}
